package net.xinqushi.design.COR;

import net.xinqushi.design.COR.impl.BossHandler;
import net.xinqushi.design.COR.impl.DeptHandler;
import net.xinqushi.design.COR.impl.ProjectHandler;

/**
 * 通常命名方式为 *Handler
 * 责任链模式，jdk源码 FilterChain
 * @see net.xinqushi.design.interceptor.interceptor
 */
public class Main {

    public static void main(String[] args) {
        ProjectHandler projectHandler =new ProjectHandler();
        DeptHandler deptHandler =new DeptHandler();
        BossHandler bossHandler= new BossHandler();
        projectHandler.setNextHandler(deptHandler);
        deptHandler.setNextHandler(bossHandler);
        projectHandler.doHandler("xjie", 450);
        projectHandler.doHandler("xjie", 1500);
        projectHandler.doHandler("guess", 1500);
    }
}
